var t = getApp();

Page({
    data: {
        tabs: [],
        list: [],
        index: 0,
        id: ""
    },
    onLoad: function(a) {
        if (a.id && this.setData({
            id: a.id
        }), a.scene) {
            var e = decodeURIComponent(a.scene);
            if (e) {
                var i = [];
                i = e.split("&");
                for (var n = 0; n < i.length; n++) {
                    var s;
                    "id" == (s = i[n].split("="))[0] ? this.setData({
                        id: s[1]
                    }) : "mid" == s[0] && t._setMid(s[1]);
                }
            }
        }
        this.data.id && this.getData();
    },
    onClick: function(t) {
        this.setData({
            index: t.detail.index
        });
    },
    getData: function() {
        var a = this;
        t._getNetWork({
            url: t.getNetAddresss("plugin.health-check.frontend.index.detail"),
            data: {
                id: this.data.id
            },
            success: function(e) {
                var i = e.data, n = i.result, s = i.data, o = i.msg;
                if (0 == n) return t.tips(o);
                var d = [];
                s.forEach(function(t) {
                    d.push(t.type_name + "检测报告");
                }), a.setData({
                    list: s,
                    tabs: d
                });
            }
        });
    },
    formatData: function(t) {
        var a = [ {
            name: this.data.type_name || "腰椎"
        }, {
            list: []
        } ], e = [ {
            name: "检测结果"
        }, {
            list: []
        } ], i = [ {
            name: "对应身体部位和区域"
        }, {
            list: []
        } ], n = [ {
            name: "可能产生的症状"
        }, {
            list: []
        } ];
        t.forEach(function(t) {
            a[1].list.push(t.code), e[1].list.push(t.area), i[1].list.push(t.status_name), n[1].list.push(t.desc);
        }), this.setData({
            category_01: a,
            category_02: e,
            category_03: i,
            category_04: n
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});